import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'

const host = process.env.HOST || "127.0.0.1"

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  base: '/statistic',
  server: {
    port: 1520,
    strictPort: true,
    host: host || false,
    hmr: host
      ? {
          protocol: "ws",
          host,
          port: 1521,
        }
      : undefined,
    watch: {
      ignored: [],
    },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, "./src"),
    }
  }
})
